//
//  MaterialData.m
//  ZCooking
//
//  Created by LL.F on 16/09/02
//  Copyright (c) __ORGANIZATIONNAME__. All rights reserved.
//

#import "MaterialData.h"
#import "MaterialSecData.h"

@implementation MaterialData

+ (NSDictionary *)objectClassInArray{
    return @{@"data" : [MaterialSecData class]};
}

- (void)setValue:(id)value forKey:(NSString *)key
{

    [super setValue:value forKey:key];
    if ([key isEqualToString:@"data"]) {
        NSMutableArray<MaterialSecData *>  *materialSecDataArray = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            MaterialSecData *materialDic = [MaterialSecData modelWithDic:dic];
            [materialSecDataArray addObject:materialDic];
        }
        _data = materialSecDataArray;
    }
}
- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    if ([key isEqualToString:@"id"]) {
        _id_Data = [value integerValue];
    }
}
@end
